﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:MiniTwitter="clr-namespace:MiniTwitter"
    xmlns:MiniTwitter_Input="clr-namespace:MiniTwitter.Input"
    xmlns:MiniTwitter_Controls="clr-namespace:MiniTwitter.Controls"
    xmlns:MiniTwitter_Net_Twitter="clr-namespace:MiniTwitter.Net.Twitter"
    xmlns:MiniTwitter_Properties="clr-namespace:MiniTwitter.Properties">
	
	<!--modified by yuki. -->
	<!--
	modify
	-Image Width and Height: 48 -> 36
	-location of Button and Text each of DataTemplate
	-->
	
    <DataTemplate x:Key="StandardStatusTemplate" DataType="{x:Type MiniTwitter_Net_Twitter:Status}">
        <Grid Margin="7,7,7,7" SnapsToDevicePixels="True" HorizontalAlignment="Stretch">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Image Width="36" Height="36" Margin="0,0,8,0" Grid.Column="0" VerticalAlignment="Top"
                   Source="{Binding Path=Sender.ImageUrl}" ToolTip="{Binding Path=Sender.Name}"
                   Visibility="{Binding Source={x:Static MiniTwitter_Properties:Settings.Default}, Path=IsIconVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
            <StackPanel Grid.Column="1" HorizontalAlignment="Stretch">
				<DockPanel HorizontalAlignment="Stretch" >
					<StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
						<MiniTwitter_Controls:HyperlinkButton Text="{Binding Path=Sender.ScreenName}" ToolTip="{Binding Path=Sender.Name}"
															  FontWeight="Bold" FontSize="13" HorizontalAlignment="Left" VerticalAlignment="Center"
															  Command="MiniTwitter_Input:Commands.MoveToUserPage" CommandParameter="{Binding}"/>
						<Image Width="12" Height="12" Margin="3,0,0,0" Visibility="{Binding Path=Sender.Protected, Converter={StaticResource BooleanToVisibilityConverter}}"
							   Style="{DynamicResource ProtectImageStyle}"/>
						<Image Width="12" Height="12" Margin="3,0,0,0" Visibility="{Binding Path=IsNewest, Converter={StaticResource BooleanToVisibilityConverter}}"
							   Style="{DynamicResource NewImageStyle}"/>
					</StackPanel>
							<WrapPanel HorizontalAlignment="Right">
						<MiniTwitter_Controls:HyperlinkButton Text="{Binding Path=RelativeTime}" FontSize="11" Margin="0,0,3,0" VerticalAlignment="Center"
															  Command="MiniTwitter_Input:Commands.MoveToStatusPage" CommandParameter="{Binding}">
							<MiniTwitter_Controls:HyperlinkButton.ToolTip>
										<StackPanel Orientation="Horizontal">
											<TextBlock Text="{Binding Path=CreatedAt, StringFormat=yyyy/MM/dd HH:mm:ss}"/>
											<TextBlock Margin="0,0,3,0" FontSize="11" VerticalAlignment="Center" Text="{Binding Path=Source, StringFormat=from \{0\}}"/>
										</StackPanel>
							</MiniTwitter_Controls:HyperlinkButton.ToolTip>
						</MiniTwitter_Controls:HyperlinkButton>
						
						<Button Margin="0,0,3,0" Padding="0" Visibility="{Binding Path=IsAuthor, Converter={StaticResource BooleanToVisibilityConverter}}"
								Command="MiniTwitter_Input:Commands.Delete" CommandParameter="{Binding}" Style="{DynamicResource ImageButtonStyle}">
							<Image Width="14" Height="14" Style="{DynamicResource CrossImageStyle}"/>
						</Button>
						<Button Margin="0,0,3,0" Padding="0" Command="MiniTwitter_Input:Commands.Favorite"
								CommandParameter="{Binding}" Style="{DynamicResource ImageButtonStyle}">
							<Image Width="14" Height="14" Style="{DynamicResource FavoriteImageStyle}"/>
						</Button>
						<Button Margin="0,0,3,0" Padding="0" Command="MiniTwitter_Input:Commands.Reply" ToolTip="Reply"
								CommandParameter="{Binding}" Style="{DynamicResource ImageButtonStyle}">
							<Image Width="14" Height="14" Style="{DynamicResource ArrowReplyImageStyle}"/>
						</Button>
						<Button Margin="0,0,3,0" Padding="0" Command="MiniTwitter_Input:Commands.ReTweet" ToolTip="ReTweet"
								CommandParameter="{Binding}" Style="{DynamicResource ImageButtonStyle}">
							<Image Width="14" Height="14" Style="{DynamicResource ArrowReTweetImageStyle}"/>
						</Button>
					</WrapPanel>
				</DockPanel>
				<MiniTwitter_Controls:TextViewer Text="{Binding Path=Text}" Margin="4"
					FontSize="{Binding Source={x:Static MiniTwitter_Properties:Settings.Default}, Path=FontSize}"
					FontWeight="{Binding Source={x:Static MiniTwitter_Properties:Settings.Default}, Path=FontWeight}"/>
			</StackPanel>
        </Grid>
    </DataTemplate>

	
	
    <DataTemplate x:Key="StandardMessageTemplate" DataType="{x:Type MiniTwitter_Net_Twitter:DirectMessage}">
        <Grid Margin="7,7,7,7" SnapsToDevicePixels="True">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid Width="48" Height="48" Margin="0,0,8,0" Grid.Column="0" VerticalAlignment="Top"
                  Visibility="{Binding Source={x:Static MiniTwitter_Properties:Settings.Default}, Path=IsIconVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
                <Image Width="36" Height="36" VerticalAlignment="Top" HorizontalAlignment="Left" Source="{Binding Path=Sender.ImageUrl}" ToolTip="{Binding Path=Sender.Name}"/>
                <Image Width="24" Height="24" VerticalAlignment="Bottom" HorizontalAlignment="Right" Source="{Binding Path=Recipient.ImageUrl}" ToolTip="{Binding Path=Recipient.Name}"/>
            </Grid>
            <StackPanel Grid.Column="1">
                <StackPanel Orientation="Horizontal">
                    <MiniTwitter_Controls:HyperlinkButton Text="{Binding Path=Sender.ScreenName}" ToolTip="{Binding Path=Sender.Name}" FontWeight="Bold" FontSize="13" HorizontalAlignment="Left" VerticalAlignment="Center" Command="MiniTwitter_Input:Commands.MoveToUserPage" CommandParameter="{Binding}"/>
                    <Image Width="12" Height="12" Margin="3,0,0,0" Visibility="{Binding Path=Sender.Protected, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{DynamicResource ProtectImageStyle}"/>
                    <Image Width="12" Height="12" Margin="3,0,0,0" Visibility="{Binding Path=IsNewest, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{DynamicResource NewImageStyle}"/>
                </StackPanel>
				<MiniTwitter_Controls:TextViewer Text="{Binding Path=Text}"/>
                <WrapPanel>
                    <TextBlock Text="{Binding Path=RelativeTime}" FontSize="11" Margin="0,0,3,0" VerticalAlignment="Center">
                        <TextBlock.ToolTip>
                            <TextBlock Text="{Binding Path=CreatedAt, StringFormat=yyyy/MM/dd HH:mm:ss}"/>
                        </TextBlock.ToolTip>
                    </TextBlock>
                    <Button Margin="0,0,3,0" Padding="0" Command="MiniTwitter_Input:Commands.Delete" CommandParameter="{Binding}" Style="{DynamicResource ImageButtonStyle}">
                        <Image Width="14" Height="14" Style="{DynamicResource CrossImageStyle}"/>
                    </Button>
                    <Button Margin="0,0,3,0" Padding="0" Command="MiniTwitter_Input:Commands.ReplyMessage" CommandParameter="{Binding}" Style="{DynamicResource ImageButtonStyle}">
                        <Image Width="14" Height="14" Style="{DynamicResource ArrowReplyImageStyle}"/>
                    </Button>
                </WrapPanel>
            </StackPanel>
        </Grid>
    </DataTemplate>
    
    <DataTemplate x:Key="BalloonStatusTemplate" DataType="{x:Type MiniTwitter_Net_Twitter:Status}">
        <Grid Margin="7,7,7,7" SnapsToDevicePixels="True">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Border Grid.Row="0" CornerRadius="4" Background="{DynamicResource BalloonBackgroundBrush}" BorderThickness="0">
                <StackPanel Margin="6,3,3,3">
                    <MiniTwitter_Controls:TextViewer Text="{Binding Path=Text}"/>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                        <MiniTwitter_Controls:HyperlinkButton Text="{Binding Path=RelativeTime}" FontSize="11" Margin="0,0,3,0" VerticalAlignment="Center"
                                                              Command="MiniTwitter_Input:Commands.MoveToStatusPage" CommandParameter="{Binding}">
                            <MiniTwitter_Controls:HyperlinkButton.ToolTip>
                                <TextBlock Text="{Binding Path=CreatedAt, StringFormat=yyyy/MM/dd HH:mm:ss}"/>
                            </MiniTwitter_Controls:HyperlinkButton.ToolTip>
                        </MiniTwitter_Controls:HyperlinkButton>
                        <TextBlock Margin="0,0,3,0" FontSize="11" VerticalAlignment="Center" Text="{Binding Path=Source, StringFormat=from \{0\}}"/>
                        <Button Margin="0,0,3,0" Padding="0" Visibility="{Binding Path=IsAuthor, Converter={StaticResource BooleanToVisibilityConverter}}"
                                Command="MiniTwitter_Input:Commands.Delete" CommandParameter="{Binding}" Style="{DynamicResource ImageButtonStyle}">
                            <Image Width="14" Height="14" Style="{DynamicResource CrossImageStyle}"/>
                        </Button>
                        <Button Margin="0,0,3,0" Padding="0" Command="MiniTwitter_Input:Commands.Favorite"
                                CommandParameter="{Binding}" Style="{DynamicResource ImageButtonStyle}">
                            <Image Width="14" Height="14" Style="{DynamicResource FavoriteImageStyle}"/>
                        </Button>
                        <Button Margin="0,0,3,0" Padding="0" Command="MiniTwitter_Input:Commands.Reply" ToolTip="Reply"
                                CommandParameter="{Binding}" Style="{DynamicResource ImageButtonStyle}">
                            <Image Width="14" Height="14" Style="{DynamicResource ArrowReplyImageStyle}"/>
                        </Button>
                        <Button Margin="0,0,3,0" Padding="0" Command="MiniTwitter_Input:Commands.ReTweet" ToolTip="ReTweet"
                                CommandParameter="{Binding}" Style="{DynamicResource ImageButtonStyle}">
                            <Image Width="14" Height="14" Style="{DynamicResource ArrowReTweetImageStyle}"/>
                        </Button>
                    </StackPanel>
                </StackPanel>
            </Border>
            <Path Grid.Row="1" Margin="8,0,0,2" Fill="{DynamicResource BalloonBackgroundBrush}" Stretch="None" Data="M0,0L12,0L6,6Z"/>
            <StackPanel Grid.Row="2" Orientation="Horizontal">
                <Image Width="32" Height="32" Margin="0,0,4,0" VerticalAlignment="Center"
                       Source="{Binding Path=Sender.ImageUrl}" ToolTip="{Binding Path=Sender.Name}"
                       Visibility="{Binding Source={x:Static MiniTwitter_Properties:Settings.Default}, Path=IsIconVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
                <MiniTwitter_Controls:HyperlinkButton Text="{Binding Path=Sender.ScreenName}" ToolTip="{Binding Path=Sender.Name}"
                                                      FontWeight="Bold" FontSize="13" HorizontalAlignment="Left" VerticalAlignment="Center"
                                                      Command="MiniTwitter_Input:Commands.MoveToUserPage" CommandParameter="{Binding}"/>
                <Image Width="12" Height="12" Margin="3,0,0,0" Visibility="{Binding Path=Sender.Protected, Converter={StaticResource BooleanToVisibilityConverter}}"
                       Style="{DynamicResource ProtectImageStyle}"/>
                <Image Width="12" Height="12" Margin="3,0,0,0" Visibility="{Binding Path=IsNewest, Converter={StaticResource BooleanToVisibilityConverter}}"
                       Style="{DynamicResource NewImageStyle}"/>
            </StackPanel>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="BalloonMessageTemplate" DataType="{x:Type MiniTwitter_Net_Twitter:DirectMessage}">
        <Grid Margin="7,7,7,7" SnapsToDevicePixels="True">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Border Grid.Row="0" CornerRadius="4" Background="{DynamicResource BalloonBackgroundBrush}" BorderThickness="0">
                <StackPanel Margin="6,3,3,3">
                    <MiniTwitter_Controls:TextViewer Text="{Binding Path=Text}"/>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                        <MiniTwitter_Controls:HyperlinkButton Text="{Binding Path=RelativeTime}" FontSize="11" Margin="0,0,3,0" VerticalAlignment="Center"
                                                              Command="MiniTwitter_Input:Commands.MoveToStatusPage" CommandParameter="{Binding}">
                            <MiniTwitter_Controls:HyperlinkButton.ToolTip>
                                <TextBlock Text="{Binding Path=CreatedAt, StringFormat=yyyy/MM/dd HH:mm:ss}"/>
                            </MiniTwitter_Controls:HyperlinkButton.ToolTip>
                        </MiniTwitter_Controls:HyperlinkButton>
                        <Button Margin="0,0,3,0" Padding="0" Command="MiniTwitter_Input:Commands.Delete"
                                CommandParameter="{Binding}" Style="{DynamicResource ImageButtonStyle}">
                            <Image Width="14" Height="14" Style="{DynamicResource CrossImageStyle}"/>
                        </Button>
                        <Button Margin="0,0,3,0" Padding="0" Command="MiniTwitter_Input:Commands.ReplyMessage"
                                CommandParameter="{Binding}" Style="{DynamicResource ImageButtonStyle}">
                            <Image Width="14" Height="14" Style="{DynamicResource ArrowReplyImageStyle}"/>
                        </Button>
                    </StackPanel>
                </StackPanel>
            </Border>
            <Path Grid.Row="1" Margin="8,0,0,2" Fill="{DynamicResource BalloonBackgroundBrush}" Stretch="None" Data="M0,0L12,0L6,6Z"/>
            <StackPanel Grid.Row="2" Orientation="Horizontal">
                <Grid Width="32" Height="32" Margin="0,0,4,0" VerticalAlignment="Center"
                      Visibility="{Binding Source={x:Static MiniTwitter_Properties:Settings.Default}, Path=IsIconVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
                    <Image Width="24" Height="24" VerticalAlignment="Top" HorizontalAlignment="Left" Source="{Binding Path=Sender.ImageUrl}" ToolTip="{Binding Path=Sender.Name}"/>
                    <Image Width="18" Height="18" VerticalAlignment="Bottom" HorizontalAlignment="Right" Source="{Binding Path=Recipient.ImageUrl}" ToolTip="{Binding Path=Recipient.Name}"/>
                </Grid>
                <MiniTwitter_Controls:HyperlinkButton Text="{Binding Path=Sender.ScreenName}" ToolTip="{Binding Path=Sender.Name}"
                                                      FontWeight="Bold" FontSize="13" HorizontalAlignment="Left" VerticalAlignment="Center"
                                                      Command="MiniTwitter_Input:Commands.MoveToUserPage" CommandParameter="{Binding}"/>
                <Image Width="12" Height="12" Margin="3,0,0,0" Visibility="{Binding Path=Sender.Protected, Converter={StaticResource BooleanToVisibilityConverter}}"
                       Style="{DynamicResource ProtectImageStyle}"/>
                <Image Width="12" Height="12" Margin="3,0,0,0" Visibility="{Binding Path=IsNewest, Converter={StaticResource BooleanToVisibilityConverter}}"
                       Style="{DynamicResource NewImageStyle}"/>
            </StackPanel>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="ListStatusTemplate" DataType="{x:Type MiniTwitter_Net_Twitter:Status}">
        <Grid Margin="2,0,2,0" SnapsToDevicePixels="True">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" SharedSizeGroup="Icon"/>
                <ColumnDefinition Width="5"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.Column="0" Orientation="Horizontal">
                <Image Width="16" Height="16" Margin="0,0,3,0" Source="{Binding Path=Sender.ImageUrl}" ToolTip="{Binding Path=Sender.Name}" Visibility="{Binding Source={x:Static MiniTwitter_Properties:Settings.Default}, Path=IsIconVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
                <MiniTwitter_Controls:HyperlinkButton Text="{Binding Path=Sender.ScreenName}" ToolTip="{Binding Path=Sender.Name}" FontWeight="Bold" FontSize="13" VerticalAlignment="Center" Command="MiniTwitter_Input:Commands.MoveToUserPage" CommandParameter="{Binding}"/>
                <Image Width="12" Height="12" Margin="3,0,0,0" Style="{DynamicResource ProtectImageStyle}" Visibility="{Binding Path=Sender.Protected, Converter={StaticResource BooleanToVisibilityConverter}}"/>
                <Image Width="12" Height="12" Margin="3,0,0,0" Visibility="{Binding Path=IsNewest, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{DynamicResource NewImageStyle}"/>
            </StackPanel>
            <MiniTwitter_Controls:TextViewer Grid.Column="2" Text="{Binding Path=Text}" ToolTip="{Binding Path=Text}" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" VerticalAlignment="Center"/>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="ListMessageTemplate" DataType="{x:Type MiniTwitter_Net_Twitter:DirectMessage}">
        <Grid Margin="2,0,2,0" SnapsToDevicePixels="True">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" SharedSizeGroup="Icon"/>
                <ColumnDefinition Width="5"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.Column="0" Orientation="Horizontal">
                <Image Width="16" Height="16" Margin="0,0,3,0" Source="{Binding Path=Sender.ImageUrl}" ToolTip="{Binding Path=Sender.Name}" Visibility="{Binding Source={x:Static MiniTwitter_Properties:Settings.Default}, Path=IsIconVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
                <MiniTwitter_Controls:HyperlinkButton Text="{Binding Path=Sender.ScreenName}" ToolTip="{Binding Path=Sender.Name}" FontWeight="Bold" FontSize="13" VerticalAlignment="Center" Command="MiniTwitter_Input:Commands.MoveToUserPage" CommandParameter="{Binding}"/>
            </StackPanel>
            <MiniTwitter_Controls:TextViewer Grid.Column="2" Text="{Binding Path=Text}" ToolTip="{Binding Path=Text}" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" VerticalAlignment="Center"/>
        </Grid>
    </DataTemplate>

</ResourceDictionary>